package cn.jiyun.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * @Author weiyuanhang
 * @data: 2023/8/22 002211:17
 * @Package cn.jiyun.entity
 * @email 3185757326@qq.com
 */
@Data
public class Result<T> {
    private String code;
    private String message;
    private T data;

    public static Result ok(Object data){
        Result<Object> res = new Result<>();
        res.setCode("1");
        res.setMessage("成功");
        res.setData(data);
        return  res;
    }
    public static Result error(){
        Result<Object> res = new Result<>();
        res.setCode("2");
        res.setMessage("失败");
        return  res;
    }
}
